package com.littleII.web.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.littleII.biz.SoftBiz;
import com.littleII.web.BaseController;

@Controller
public class SoftController extends BaseController {
	private static Logger logger = Logger.getLogger(SoftController.class);

	@Autowired
	private SoftBiz softBiz;//软件业务流程对象

	/**
	 * @return the softBiz
	 */
	public SoftBiz getSoftBiz() {
		return softBiz;
	}

	/**
	 * @param softBiz the softBiz to set
	 */
	public void setSoftBiz(SoftBiz softBiz) {
		this.softBiz = softBiz;
	}

	@RequestMapping(value = "/soft/test1", method = RequestMethod.GET)
	public String test1() {
		logger.info("soft.do test1");
		return "/user.do?user=a&pwd=b";
	}

	@RequestMapping(value = "/soft/test2", method = RequestMethod.GET)
	public ModelAndView test2(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		logger.info("soft.do test2");
		softBiz.test();
		ModelAndView mav = new ModelAndView("/index.jsp");
		mav.addObject("message", "Hello World!");
		mav.addObject("a", "xx");
		return mav;
	}
}
